#ifndef ModeLobby_h__
#define ModeLobby_h__

#include <GTL.h>
#include <GTLEngine.h>

#include "Game.h"

using namespace GTL::Structures;
using namespace GTL::Engine;

class ModeLobby : public GTL::Engine::GameMode<SummonerGame>
{
public:
	gui (gMain, "Data/gui/lobby.wilson");
	resource(Font, fMain, "Data/cour.ttf");
	GTL::Engine::NetworkService* net;

	eastl::string ChatText;

	virtual int Draw(float dt);
	virtual int Load();
	virtual int Event(GTL::Engine::GameEvent event); /// TODO: Finish me;
	virtual int Unload();
	virtual int Update(float dt);

	void DoPlayerPacket( SummonerGame::Player* from, DataNodeWilson& w, const eastl::string& type );
	void DoConnectionPacket( ClientConnection* conn, DataNodeWilson& w, const eastl::string& type );
	SummonerGame::Player* FindPlayer( int id );
	void DoServerPacket( GTL::Structures::DataNodeWilson& w, const eastl::string& type );
	bool EverybodyReady();
};

#endif